package com.c.rabbit_mq.impl;

import com.c.rabbit_mq.ComRabbitMqHandle;
import com.tool.rabbit.RabbitMsgBO;
import com.tool.rabbit.ToolRabbitMQ;
import ntd.util.modular.data.util.handle.tool.Tool212;

/**
 * 给客户端的回复消息 - 不验证是否发送成功
 */
public class IotMsgPush extends ComRabbitMqHandle<RabbitMsgBO> {

    public static final String TOPIC = "/com-server/212_msg_push";

    public IotMsgPush() {
        super(TOPIC, RabbitMsgBO.class);
    }

    @Override
    public void handle(String topic, RabbitMsgBO rabbitMsgBO) {
        Tool212.sendMsg(rabbitMsgBO.getCode(), rabbitMsgBO.getData());
    }

    public static void push(RabbitMsgBO rabbitMsgBO) {
        ToolRabbitMQ.push(TOPIC, rabbitMsgBO.toString());
    }
}
